home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / ncsat.cpt / Telnet2.5 final / main / procs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-04  |  3.0 KB  |  101 lines

  1. /*
  2. *    procs.c
  3. *     by Gaige B. Paulsen
  4. ****************************************************************************
  5. *    Part of NCSA Telnet for the Macintosh                                   *
  6. *                                                                          *
  7. *      Uses    :                                                               *
  8. *      TCP/IP kernel for NCSA Telnet                                       *
  9. *      by Tim Krauskopf                                                    *
  10. *       with Macintosh code by Gaige B. Paulsen                                 *
  11. *                                                                          *
  12. *      National Center for Supercomputing Applications                     *
  13. *      152 Computing Applications Building                                 *
  14. *      605 E. Springfield Ave.                                             *
  15. *      Champaign, IL  61820                                                *
  16. *                                                                          *
  17. *                                                                          *
  18. ****************************************************************************
  19. *
  20. *    A place to put some of those routines called by lots of people.
  21. *
  22. *    Called by:
  23. *        menu.c
  24. *        maclook.c
  25. *        prefs.c
  26. */
  27.  
  28. /*
  29.  *    Files for inclusion.
  30.  */
  31. #include    <stdio.h>
  32. #include    <ctype.h>
  33.  
  34. #include    <Controls.h>
  35. #include    <Desk.h>
  36. #include    <Dialogs.h>
  37. #include    <Events.h>
  38. #include    <Fonts.h>
  39. #include    <Menus.h>
  40. #include    <OSUtils.h>            /* for Juggler */
  41. #include    <Packages.h>
  42. #include    <Quickdraw.h>
  43. #include    <Resources.h>
  44. #include    <Script.h>
  45. #include    <ToolUtils.h>
  46. #include    <Windows.h>
  47.  
  48. #include    "VSkeys.h"
  49. #include "util.h"
  50.  
  51. #include    "wind.h"
  52.  
  53. #ifdef MPW
  54. #include "mpw.h"
  55. #endif
  56.  
  57.  
  58. /*
  59.  * Event Auxilliary Defines
  60.  */
  61.  
  62. #define    MouseEvents    6        /* All mouse events, but no others */
  63. #define WaitEvents    10        /* Mouse and Keyboard Dn Events for the Wait4Mouse() */
  64. #define    BScode        51        /* This is the Keycode for Backspace */
  65. #define KPlowest    65        /* This is the last code before the KP */
  66.  
  67. #define switchEvt     1        /* Switching event (suspend/resume )  for app4evt */
  68.  
  69. #define WAITTICKS    3L        /* One (Half) now tenth now 1/20th second for the first try.... */
  70.  
  71. pascal short modalProc( dptr, evt, item)
  72. DialogPtr dptr;
  73. EventRecord *evt;
  74. short *item;
  75. {
  76. #pragma unused(dptr)
  77.     extern int neton;                /* From Maclook, if net has been inited yet */
  78.     extern short modalItems,modalItem[],modalKey[];    /* BYU serial - From menu.c, item # for option key */
  79.     int keyCount,keyCode;                            /* BYU serial - added keyCount */
  80.  
  81.     if (evt->what == keyDown) {
  82.         keyCode = (evt->message >>8) & 0xff ;
  83.         if (keyCode  ==0x24 || keyCode == 0x4c) {
  84.             *item = 1;
  85.             return(TRUE);
  86.             }
  87.         if (keyCode ==0x2f && (evt->modifiers & cmdKey)) {
  88.             *item = 2;
  89.             return(TRUE);
  90.             }
  91.         for (keyCount = 0; keyCount < modalItems; keyCount++) {                    /* BYU serial */
  92.             if ((keyCode ==modalKey[keyCount]) && (evt->modifiers & cmdKey)) {    /* BYU serial */
  93.                 *item = modalItem[keyCount];                                    /* BYU serial - enable option */
  94.                 return(-1);                    /* BYU serial */
  95.                 }                            /* BYU serial */
  96.             }
  97.         }
  98.     if (neton) Stask();
  99.     return(FALSE);
  100. }
  101.